﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteRequireLogin.Master" AutoEventWireup="true" CodeBehind="DanhSachCauHoi.aspx.cs" Inherits="TranTekBE.Trac_Nghiem.DanhSachCauHoi" %>

<%@ Register Src="~/Trac-Nghiem/MenuTracNghiem.ascx" TagPrefix="uc1" TagName="MenuTracNghiem" %>
<%@ Register Src="~/KPI-NhanSu/Menu-KPI.ascx" TagPrefix="uc1" TagName="MenuKPI" %>



<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <style type="text/css">
        .paging table tr td span, .paging table tr td a {
            padding: 2px 8px;
            margin: 2px;
            border-radius: 14px;
        }

            .paging table tr td span, .paging table tr td a:hover {
                background-color: white;
                color: blue !important;
            }

        .ui-dialog {
            z-index: 2147483647;
        }

        a {
            color: blue;
        }

        .table td, .table th {
            border: 1px solid #CCCCCC;
        }

        .table tr:nth-child(1), .table tr:nth-child(1) td {
            background-color: #B7B7B7;
            font-size: 1em;
            font-weight: bold;
            padding: 6px 5px !important;
            text-align: center !important;
        }

        .table th {
            text-align: center !important;
            vertical-align: middle !important;
        }

        .table tr:nth-child(2n) td {
            background-color: #FFFFE0;
        }

        .table tr:nth-child(2n+1) td {
            background-color: #D7E3F2;
        }

        .t-center {
            text-align: center !important;
        }

        a:hover {
            text-decoration: underline;
        }

        .noi-dung {
            min-width: 500px;
        }

        .table td {
            border-top: 1px solid #EBDADA;
            line-height: 18px;
            padding: 2px !important;
            text-align: left;
            vertical-align: top;
        }
    </style>
    <link href="../Styles/myStyle.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="server">

    <br />
    <br />
    <br />
    <br />
    <div>
        <uc1:MenuKPI runat="server" ID="MenuKPI" />
        <br/>
        <uc1:MenuTracNghiem runat="server" ID="MenuTracNghiem" />
        <h2 style="">Danh Sách Câu Hỏi </h2>
        <div style="width: 100%;">
            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
             <a style=""
                href="#Them cau hoi" class="btn btn-success" onclick="OpenDialog('Thêm Câu Hỏi', 'ThemCauHoi.aspx',650, 900);return false;">Thêm Câu Hỏi</a>
            <asp:LinkButton class="btn btn-success .btnReload" ID="Button2" runat="server" Text="Reload" OnClick="Button2_Click" />
            <span>Chọn Danh Mục:</span>
            <span>
                <asp:DropDownList ID="ddlCategory" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlCategory_SelectedIndexChanged">
                    <asp:ListItem Value="" Text="--Tất Cả--"></asp:ListItem>
                </asp:DropDownList></span>
            <span>Tổng số:
                <asp:Literal ID="LiteralTongSo" runat="server"></asp:Literal>
            </span>
            <span>
                <asp:TextBox ID="txtSearch" placeholder="Tìm theo nội dung" OnTextChanged="txtSearch_TextChanged" AutoPostBack="true" runat="server"></asp:TextBox>
            </span>
           
</ContentTemplate>
            </asp:UpdatePanel>
        </div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>

                <asp:GridView ID="GridView1" CssClass="table" runat="server" AllowPaging="True" CellPadding="4" EnableModelValidation="True" GridLines="None" OnPageIndexChanging="GridView1_PageIndexChanging" AutoGenerateColumns="False" OnRowDeleting="GridView1_RowDeleting">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:TemplateField HeaderText="STT." ItemStyle-CssClass="t-center">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex +1 %>'></asp:Label>
                                <asp:HiddenField ID="QuestionId" runat="server" Value='<%# Eval("QuestionId") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Nội Dung" ItemStyle-CssClass="noi-dung">
                            <ItemTemplate>
                                <a class="editQuestion" onclick="OpenDialog('Sửa Câu Hỏi', 'ThemCauHoi.aspx?id=<%# Eval("QuestionId") %>',650, 900);return false;" href="#Sửa Nội Dung" title="Sửa câu hỏi.">
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("Content") %>'></asp:Label></a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Danh Mục">
                            <ItemTemplate>
                                <asp:Label ID="Label4" runat="server" Text='<%#  Eval("Name").ToString().Replace(" ","&nbsp;")%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Ngày Cập Nhật">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# TinyLib.VNDate( Eval("UpdatedDate").ToString())%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:Button ID="Button1" runat="server" CausesValidation="False" CommandName="Delete" Text="Xóa" OnClientClick="return confirm('Xóa câu hỏi này?')"></asp:Button>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EditRowStyle BackColor="#2461BF" />
                    <FooterStyle Font-Bold="True" />
                    <PagerStyle CssClass="paging" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                </asp:GridView>

            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <br />
    <br />
    <br />
    <script type="text/javascript">
        //OpenDialog("Xử Phạt Nhân Viên", "Phat-Nhan-Vien.aspx?UserNamePunish=" + idp, 300, 500);
        function ReloadWindow() {
            javascript: __doPostBack('ctl00$BodyContent$Button2', '');
        }
    </script>
</asp:Content>
